Skip to content

feat: stop spinner on process exit #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 4, 2024
Merged

feat: stop spinner on process exit #2

merged 7 commits into from
Nov 4, 2024

Conversation

43081j
Copy link
Member

@43081j 43081j commented Nov 3, 2024

Stops the spinner when SIGTERM or SIGINT is received.

cc @PondWader

Stops the spinner when `SIGTERM` or `SIGINT` is received.
@PondWader
Copy link
Collaborator

Looking at other implementations aren't there more signals we need to use? See https://github.com/tapjs/signal-exit/blob/main/src/signals.ts

Copy link
Collaborator

@PondWader PondWader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm happy to not listen for any other signals, SIGHUP for example will only be called once the terminal is closed so it's pointless to respond to it. I'm not sure why exit libraries listen to so many events tbh.

@43081j
Copy link
Member Author

43081j commented Nov 4, 2024

all should be sorted now 👍

on exit event we process.exit with the code that was passed

on SIGINT and SIGTERM, we exit with 128 + {code} as per node's docs (for whatever reason)

@PondWader PondWader merged commit b1173af into main Nov 4, 2024
3 checks passed
@43081j 43081j deleted the prexit branch November 4, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants